#!/bin/sh

set -e

case "$1" in
  configure)
    if ! getent passwd httpcvd > /dev/null 2>&1
    then
        adduser --system --disabled-password --disabled-login --home /var/empty \
                --no-create-home --quiet --force-badname --group httpcvd

        usermod -a -G cvdnetwork,kvm httpcvd
    fi

    # Reload nginx having the orchestration configuration
    service nginx reload
esac

#DEBHELPER#
